package com.robinmouren.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.robinmouren.dto.*;
import com.robinmouren.entity.Driver;
import com.baomidou.mybatisplus.extension.service.IService;
import com.robinmouren.exception.BaseException;
import com.robinmouren.vo.DriverPageVo;
import com.robinmouren.vo.ToBeQuoteVo;
import com.robinmouren.vo.ToGetDriverQuoteVo;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 司机表，记录司机车辆信息 服务类
 * </p>
 *
 * @author Robinmouren
 * @since 2024-05-18
 */
public interface IDriverService extends IService<Driver> {


    /**
     * 司机信息分页查询
     * @param pageDto
     * @return
     */
    Page<DriverPageVo> driverPage(DriverPageDto pageDto);


    /**
     * 向司机报价
     * @param quoteToDriverDto
     */
    void addQuote(QuoteToDriverDto quoteToDriverDto);

    /**
     * 司机待报价分页查询
     * @param dto
     * @return
     */
    Page<ToBeQuoteVo> toBePage(QuotationPageDto dto);


    /**
     * 司机报价
     * @param dto
     */
    @Transactional(rollbackFor = BaseException.class)
    void driverQuote(DriverQuoteDto dto);

    /**
     * 承运商获取运输询价
     * @param orderNumber
     * @return
     */
    ToGetDriverQuoteVo toGetDriverQuote(String orderNumber);


    /**
     * 承运商报价
     * @param dto
     */
    void carriersQuote(CarriersQuoteDto dto);
}
